home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
PGM_TOOL
/
PREVIEW
/
WYNFORM.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1995-11-10
|
2KB
|
73 lines
unit Wynform;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, Buttons;
type
Tynform = class(TForm)
byes: TBitBtn;
bno: TBitBtn;
bok: TBitBtn;
Label1: TLabel;
bcancel: TBitBtn;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
procedure Setup(style:integer;sCaption,sText:string);
end;
var
ynform: Tynform;
implementation
{$R *.DFM}
procedure Tynform.FormCreate(Sender: TObject);
begin
width:=430;
height:=132;
top:=(screen.height-height) div 2;
left:=(screen.width-width) div 2;
end;
procedure Tynform.Setup(style:integer;sCaption,sText:string);
begin
if style=1 then begin { OK box }
byes.visible:=false;
bno.visible:=false;
bcancel.visible:=false;
end;
if style=2 then begin { Yes/no box }
bok.visible:=false;
byes.left:=109;
bno.left:=225;
byes.visible:=true;
bno.visible:=true;
end;
if style=3 then begin { Yes/no/cancel box }
bok.visible:=false;
byes.left:=45;
bno.left:=166;
bcancel.left:=288;
byes.visible:=true;
bno.visible:=true;
bcancel.visible:=true;
end;
caption:=sCaption;
label1.caption:=sText;
end;
procedure Tynform.FormClose(Sender: TObject; var Action: TCloseAction);
begin
action:=caFree;
end;
end.